//
//  CustomFontViewController.m
//  CustomsFont
//
//  Created by 王汉昌 on 15/12/31.
//  Copyright © 2015年 離去之原. All rights reserved.
//

#import "CustomFontViewController.h"

@interface CustomFontViewController ()

@end

@implementation CustomFontViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
#pragma mark -获取字体目录
    NSArray *familyNames = [UIFont familyNames];
    for( NSString *familyName in familyNames )
    {
        NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];
        for( NSString *fontName in fontNames )
        {
            //打印
//            printf( "\tFont: %s \n", [fontName UTF8String] );
        }
    }
    
    UILabel *label = [[UILabel alloc] init];
    label.frame = self.view.frame;
    NSString *str = [NSString stringWithFormat:@"汉体书写信息技术标准相容\n档案下载使用界面简单\n支援服务升级资讯专业制作\n创意空间快速无线上网\n㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩\nAaBbCc ＡａＢｂＣｃ\n%@",self.fontName];
    label.backgroundColor = [UIColor greenColor];
    label.numberOfLines = 7;
    label.text = str;
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont fontWithName:self.fontName size:25];
    [self.view addSubview:label];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
